home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 8
/
Eagles_Nest_Mac_Collection_Disc_8.TOAST
/
Developer Tools⁄Additions
/
InsideBa1994
/
InsideBasic-94
/
IB 94
/
Snow Flakes
/
Snow Flake
Wrap
Text File
|
1990-08-09
|
2KB
|
98 lines
WINDOW OFF
COORDINATE WINDOW
DIM T,L,B,R
DIM ScrnT,ScrnL,ScrnB,ScrnR
DIM SnowFlake(25,1)
CALL GETWMGRPORT(WMgrPort&)
BLOCKMOVE WMgrPort&+8,VARPTR(ScrnT),8
T = 0:L = 0:B = 280:R = 200
CALL OFFSETRECT(T,ScrnR/2-R/2,(ScrnB/2+8)-B/2)
WINDOW 1,"",(L,T)-(R,B),4
GrafPortRgn& = PEEK LONG(WINDOW(14)+24)
ScratchRgn& = FN NEWRGN
WndFrmRgn& = FN NEWRGN
WPaneRgn& = FN NEWRGN
StoreRgn& = FN NEWRGN
CALL COPYRGN(GrafPortRgn&,StoreRgn&)
GOSUB"Draw Frame"
T=0:L=0:B=WINDOW(3)-1:R=WINDOW(2)-1
CALL INSETRECT(T,48,48)
Wd=(R-L)/2-4:Ht=(B-T)/4-4
L=L+2 : R=L+Wd
T=T+2 : B=T+Ht
CALL RECTRGN(ScratchRgn&,T)
GOSUB"Add Regions"
FOR X=1 TO 3
CALL OFFSETRECT(T,0,Ht+4)
CALL RECTRGN(ScratchRgn&,T)
GOSUB"Add Regions"
NEXT
CALL ERASERGN(WndFrmRgn&)
CALL FRAMERGN(WndFrmRgn&)
CALL COPYRGN(WPaneRgn&,GrafPortRgn&)
CALL INVERTRGN(GrafPortRgn&)
T=0:L=0:B=WINDOW(3)-1:R=WINDOW(2)-1
CALL INSETRECT(T,50,50)
PEN ,,,,19
FOR Flake = 0 TO 25
SnowFlake(Flake,0)=RND(R-L)+L
SnowFlake(Flake,1)=RND(B-T)+T
PLOT SnowFlake(Flake,0),SnowFlake(Flake,1)
NEXT
DO
FOR Flake = 0 TO 25
PEN,,,,19
PLOT SnowFlake(Flake,0),SnowFlake(Flake,1)+1
PEN,,,,0
PLOT SnowFlake(Flake,0),SnowFlake(Flake,1)
SnowFlake(Flake,1) = SnowFlake(Flake,1) + 1
LONG IF SnowFlake(Flake,1)>B
SnowFlake(Flake,0)=RND(R-L)+L
SnowFlake(Flake,1)=T
END IF
NEXT
UNTIL FN BUTTON OR LEN(INKEY$)
CALL COPYRGN(StoreRgn&,GrafPortRgn&)
CALL DISPOSERGN(ScratchRgn&)
CALL DISPOSERGN(WPaneRgn&)
CALL DISPOSERGN(WndFrmRgn&)
END
"Add Regions"
CALL UNIONRGN (ScratchRgn&,WndFrmRgn&,WndFrmRgn&)
CALL INSETRGN (ScratchRgn&,1 , 1)
CALL UNIONRGN (ScratchRgn&,WPaneRgn& ,WPaneRgn& )
CALL INSETRGN (ScratchRgn&,-1,-1)
CALL OFFSETRGN(ScratchRgn&,Wd+4,0)
CALL UNIONRGN (ScratchRgn&,WndFrmRgn&,WndFrmRgn&)
CALL INSETRGN (ScratchRgn&,1 , 1)
CALL UNIONRGN (ScratchRgn&,WPaneRgn& ,WPaneRgn& )
CALL INSETRGN (ScratchRgn&,-1,-1)
RETURN
"Draw Frame"
PEN 1,1,1,8,28
CALL PAINTRGN(GrafPortRgn&)
CALL PENNORMAL
T=0:L=0:B=WINDOW(3)-1:R=WINDOW(2)-1
CALL INSETRECT(T,44,44)
CALL OFFSETRECT(T,1,1)
CALL FRAMERECT(T)
CALL OFFSETRECT(T,-1,-1)
CALL ERASERECT(T)
CALL FRAMERECT(T)
CALL INSETRECT(T,-6,-6)
T=B-7
CALL OFFSETRECT(T,1,1)
CALL FRAMERECT(T)
CALL OFFSETRECT(T,-1,-1)
CALL ERASERECT(T)
CALL FRAMERECT(T)
RETURN